﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using System;

namespace Jumei.Model.Business.MemberManage
{
    /// <summary>
    /// 会员表
    /// </summary>
	[Table(Name = "mb_member")]
    [Index("idx_{tablename}_01", nameof(Account) + "," + nameof(TenantId), true)]
    [Index("idx_{tablename}_02", nameof(Account),false)]
    [Index("idx_{tablename}_03", nameof(Mobile), false)]
    [Index("idx_{tablename}_04", nameof(RealName), false)]
    public class MemberEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [Column(StringLength = 20)]
        public string Account { get; set; }

        /// <summary>
        /// 加密盐值
        /// </summary>
        [Column(StringLength = 50)]
        public string Salt { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(StringLength = 20)]
        public string Password { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Column(StringLength = 20)]
        public string Mobile { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [Column(StringLength = 100)]
        public string Email { get; set; }

        /// <summary>
        /// 分组
        /// </summary>
        public string GroupId { get; set; }

        /// <summary>
        /// 信用1
        /// </summary>
        public int Credit1 { get; set; }

        /// <summary>
        /// 信用2
        /// </summary>
        public int Credit2 { get; set; }

        /// <summary>
        /// 信用3
        /// </summary>
        public int Credit3 { get; set; }

        /// <summary>
        /// 信用4
        /// </summary>
        public int Credit4 { get; set; }

        /// <summary>
        /// 信用5
        /// </summary>
        public int Credit5 { get; set; }

        /// <summary>
        /// 信用6
        /// </summary>
        public int Credit6 { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [Column(StringLength = 50)]
        public string RealName { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column(StringLength = 50)]
        public string NickName { get; set; }

        /// <summary>
        /// 签名
        /// </summary>
        [Column(StringLength = 200)]
        public string Signature { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [Column(StringLength = 100)]
        public string Avatar { get; set; }

        /// <summary>
        /// QQ
        /// </summary>
        [Column(StringLength = 22)]
        public string QQ { get; set; }

        /// <summary>
        /// VIP
        /// </summary>
        public int VIP { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column(MapType = typeof(int))]
        public GenderType? Gender { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        public DateTime Brithday { get; set; }

        /// <summary>
        /// 会员积分
        /// </summary>
        public int Score { get; set; }

        /// <summary>
        /// 历史消费总积分
        /// </summary>
        public int HistoryTotalScore { get; set; }

        /// <summary>
        /// 最后登录IP
        /// </summary>
        [Column(StringLength = 16)]
        public string LastLoginIP { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLoginTime { get; set; }
    }
}
